import React, { Component } from 'react'
import style from './tuijian.module.scss'
import Axios from 'axios'
export default class tuijian extends Component {

    state = {
        data: []
    }

    componentDidMount() {
        Axios.get('https://dubai.aihuishou.com/dubai-gateway/common/channel-info/7?cityId=76&inquiryKey=&productId=&lantitude=&longitude=', {
            headers: {
                'Ahs-App-Id': '10002',
                'Ahs-Guid': '263fc5e7-143b-6e87-10d5-dfc8a8f1a410',
                'Ahs-Sign': '22f7fa2215e3ff7980ddbe29ecc98966',
                'Ahs-Timestamp': '1579239947'
            }
        }).then(res => {
            console.log(res.data.data)
            this.setState({
                data: res.data.data
            })
        })
    }

    render() {
        return (
            <div>
                {
                    this.state.data.length ?
                        <div className={style.tuijian}>
                            <img className={style.touimg} src={this.state.data[0].item.coupon.headImgUrl} alt={this.state.data[0].item.coupon.title} />
                            <div className={style.youhui}></div>
                            <dl className={style.youhuidl}>
                                <dt className={style.youhuidt}>
                                    <div className={style.youhuidtleft}></div>
                                    <div className={style.youhuidtright}></div>
                                </dt>
                                <dd className={style.youhuidd}></dd>
                            </dl>
                        </div>
                        : null
                }
            </div>
        )
    }
}
